<template>
  <PageContainer>
    <view class="container">
      <InvitationRankingMain
        :activityId="activityId"
        :role-type="RoleType.ADMIN"
        @to-detail="toDetail"
      ></InvitationRankingMain>
    </view>
  </PageContainer>
</template>

<script lang="ts" setup>
  /* invitationRanking 邀请排行 */

  import PageContainer from '@/components/PageContainer/index.vue';
  import InvitationRankingMain from '../../../components/InvitationRankingMain/index.vue';
  import { ref } from 'vue';
  import { RoleType } from '@/enums/publicModuleEnum';
  import { navigateTo, onLoad } from '@/router';

  const activityId = ref<number>();
  onLoad<'invitationRanking'>(async (op) => {
    activityId.value = op.activityId;
  });

  const toDetail = (appUserInfoId: number) => {
    navigateTo({
      name: 'invitationRankingDetail',
      options: {
        appUserInfoId,
        activityId: activityId.value!,
      },
    });
  };
</script>

<style lang="scss" scoped></style>
